import request from '@/utils/request'

// 查询科研专利信息列表
export function listPatent(query) {
  return request({
    url: '/system/patent/list',
    method: 'get',
    params: query
  })
}

// 查询科研专利信息详细
export function getPatent(id) {
  return request({
    url: '/system/patent/' + id,
    method: 'get'
  })
}

// 新增科研专利信息
export function addPatent(data) {
  return request({
    url: '/system/patent',
    method: 'post',
    data: data
  })
}

// 修改科研专利信息
export function updatePatent(data) {
  return request({
    url: '/system/patent',
    method: 'put',
    data: data
  })
}

// 修改科研专利信息
export function updateStatus(data) {
  return request({
    url: '/system/patent/status',
    method: 'put',
    data: data
  })
}

// 删除科研专利信息
export function delPatent(id) {
  return request({
    url: '/system/patent/' + id,
    method: 'delete'
  })
}



export function getPatentCountByDept(query) {
  return request({
    url: '/system/patent/dept-count',
    method: 'get',
    params: query
  })
}

export function getPatentCountByStatus(query) {
  return request({
    url: '/system/patent/status-count',
    method: 'get',
    params: query
  })
}

export function getPatentInfoForCard(query) {
  return request({
    url: '/system/patent/dashboard-card-info',
    method: 'get',
    params: query
  })
}

export function getResearchResultsByDept(query) {
  return request({
    url: '/system/patent/researchResultsByDept',
    method: 'get',
    params: query
  })
}


export function getPatentsByYearWithGrowth(query) {
  return request({
    url: '/system/patent/patentsByYear',
    method: 'get',
    params: query
  })
}


export function getPatentsByType(query) {
  return request({
    url: '/system/patent/patentsByType',
    method: 'get',
    params: query
  })
}


export function getPatentsByApplicationStatus(query) {
  return request({
    url: '/system/patent/patentsByApplicationStatus',
    method: 'get',
    params: query
  })
}
